<?php
/**
 * Created by PhpStorm.
 * @author: LIZHEN
 * @version $Id: View.php 19582 13-12-13 上午11:16 jieyin $
 * @package 
 */

//直接使用 smarty 了
include FRAMEWORK_PATH ."/Vendor/smarty/Smarty.class.php";

class View extends Base {

    private $_smarty = null;

    const VIEW_BASE_PATH = '/Views/';

    public function __construct(){
        $this->_smarty = new Smarty();
        $this->_smarty->caching = C('cache=>viewCacheOn');
        $this->_smarty->template_dir = MODULES_PATH.'/Views';
        $this->_smarty->compile_dir = CACHE_PATH;
        $this->_smarty->cache_dir = CACHE_PATH;
        $this->_smarty->left_delimiter = C('view=>leftDelimiter');
        $this->_smarty->right_delimiter = C('view=>rightDelimiter');
    }

    public function assign($name,$val) {
        $this->_smarty->assign($name,$val);
    }
	
    public function display($file) {
        $this->_smarty->display($file);
    }

}